Repository navigation
chore: merging the nanobind work into main - #131
Conversation
…le) and cctbx+newmat
…#112,#113,#114,#115,#116) - Update extern/objcryst submodule to origin/master (30fc8df), adding: GetRwHistory, minRwpVar, ReflectionProfilePseudoVoigtTCH, PowderPatternBackgroundHist, fixed aniso PV constructor, etc. - nb_lsq.cpp: Add GetVarianceCovarianceMap() (dict keyed by name tuples), GetRwHistory() (list of Rw fractions per cycle), minRwpVar arg to Refine/SafeRefine, verbose overload for PrepareRefParList, fix SafeRefine to pass maxChi2factor in correct position - nb_reflectionprofile.cpp: Expose concrete ReflectionProfilePseudoVoigt, ReflectionProfilePseudoVoigtTCH (8-arg SetProfilePar), and ReflectionProfilePseudoVoigtAnisotropic; add IsAnisotropic() to base - nb_powderpatterndiffraction.cpp: Add X2XCorrPhase() method and SetProfile() (installs a copy of a given ReflectionProfile) - nb_crystal.cpp: Fix pre-existing build error: replace nb::detail::keep_alive (non-existent in nanobind 3.x) with nb::keep_alive<1,2>() annotation - CMakeLists.txt: Add homebrew include paths for Boost headers on macOS - src/pyobjcryst/reflectionprofile.py: Export new concrete profile classes - tests: Port new tests for all features from main branch and open PRs Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- pyproject: requires-python <3.16, add 3.15 classifier, version 2026.2.0rc0, add libboost-headers to build requirements. - CMake: locate Boost headers from the libboost-headers Python package, else BOOST_INCLUDE_DIR or system/conda headers; drop hardcoded include paths. - requirements/conda.txt: drop libboost-python and libobjcryst, add compilers. - requirements/pip.txt: add libboost-headers. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Picks up vincefn/objcryst fixes since 30fc8df: - Invalidate March-Dollase texture cache in SetPhasePar, implement DeletePhase (vincefn/objcryst#105) - Recalculate powder pattern when Radiation changes (vincefn/objcryst#104) - Fix TextureEllipsoid implementation (vincefn/objcryst#103) - Le-Bail: update extracted intensities if number of reflections changed (vincefn/objcryst#99) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…obind (#122) * feat: port March-Dollase texture (#119) and TOF profile (#120) to nanobind - Bind TextureMarchDollase and PowderPatternDiffraction.GetTextureMarchDollase. SetPhasePar is bound directly (no RefinablePar workaround) since the objcryst submodule (ba6ca89, vincefn/objcryst#105) now clicks the texture clock; DeletePhase is also exposed. - TextureMarchDollase has RefinableObj as a second (non-zero offset) base, so it is registered standalone with bind_refinableobj_forwarding and added to extractRefinableObjArg. - Bind ReflectionProfileDoubleExponentialPseudoVoigt; SetProfile gives a TOF profile copy the crystal's unit cell. - Port tests and news items, with extra DeletePhase tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * [pre-commit.ci] auto fixes from pre-commit hooks * ci: check out submodules and exclude vendored extern/ from pre-commit - Pass submodules: 'true' to the scikit-package reusable workflows, so that extern/objcryst is available when building. - Exclude extern/ (objcryst submodule, vendored cctbx and newmat) from pre-commit hooks. - Remove duplicated test_lsq_compiled_refined_obj_erase_all_param_set (F811) and fix a typo flagged by codespell. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * [pre-commit.ci] auto fixes from pre-commit hooks * [pre-commit.ci] auto fixes from pre-commit hooks * docs: keep inline code on one line so prettier output is stable Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * revert: restore vendored extern/ sources modified by pre-commit.ci autofix Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Fix lifetime management regressions in Atom bindings * test: add Atom/ScatteringPower lifetime tests (#123) --------- Co-authored-by: Vincent Favre-Nicolin <vincent.favre-nicolin@esrf.fr> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The published wheels needed libObjCryst/libboost_python (Linux, macOS, Windows) from a conda environment: the old shared wheel workflow ran auditwheel and then removed the bundled libraries and pointed RPATH at the conda prefix. The nanobind build links ObjCryst++, cctbx and newmat statically and Boost is header-only, so build the wheels with cibuildwheel: - add [tool.cibuildwheel] (cp312-cp315; manylinux x86_64, macOS native, Windows AMD64; tests run on every wheel) - use the cibuildwheel shared workflow from SYMSCAE/release-scripts until it is released in scikit-package/release-scripts@v0 - derive the version from git tags with setuptools-scm instead of the static 2026.2.0rc0 placeholder - declare packaging as a runtime dependency (used by powderpattern) - trim unused ObjCryst++ submodule parts from the sdist - guard the GCC-only -O0 flag and add MSVC settings in CMakeLists.txt - ship the licenses of the statically linked code in the wheel Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nanobind has no global converter for CrystVector_REAL/CrystMatrix_REAL, so bindings that returned them directly raised when called. Wrap them in crystvec_to_array/crystmat_to_array: - UnitCell.GetLatticePar(), UnitCell.GetOrthonormalCoords() - Crystal.GetMinDistanceTable() - ScatteringPower.GetScatteringFactor(), GetTemperatureFactor(), GetResonantScattFactReal(), GetResonantScattFactImag(), (both in the base binding and in the forwarding for ScatteringPowerAtom and GlobalScatteringPower) Add tests that call each method, plus a check that no binding's signature still returns a raw CrystVector/CrystMatrix. fixes #127
fix: remove single-argument binding of PrepareRefParList to make it silent by default
fix: return numpy arrays from CrystVector/CrystMatrix bindings
fix: use cibuildwheel for building PyPI wheel
|
oops, this seems to have migrated from main at some point. I am not sure when or how, but I would rather that @clemisch or @vincefn took a look because some of it is in the Also, we seem to have two migrate-nano branches ( |
Re-implement test_anisotropic_profile_depends_on_hkl, test_set_profile_copies_reusable_template and test_set_profile_accepts_temporary (from #112) against the nanobind API. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
I'll handle the divergence with main, latest main commits had already been ported to the nanobind branch. README also needs to be updated (no scons) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #131 +/- ##
=======================================
Coverage ? 98.80%
=======================================
Files ? 22
Lines ? 2343
Branches ? 0
=======================================
Hits ? 2315
Misses ? 28
Partials ? 0 🚀 New features to boost your workflow:
|
Drop SCons and libobjcryst instructions, describe self-contained PyPI wheels, building from source with submodules, and Debug builds via scikit-build-core. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
README updated but probably would benefit from some more careful cleanup.. |
|
Thanks @vincefn! I see a bunch of stuff on here that seems as if it is beyond nanobind, such as henke tables etc.. I am ready to merge, but please could you just confirm that this is ok on this PR? |
|
I went ahead and merged....look for the rc release. |
Thanks for merging ! Yes things like henke tables are normal - before it was |
As the title suggests.